import { request } from 'umi';

/** 获取仓库的出入库统计数据 */
export async function getStockInOutCountByWarehouse(options?: { [key: string]: any }) {
  return request<BaseResponse<API.StockInOutSummaryByWarehouse>>('/api/chart/stock-in-out-count', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 获取按照仓库维度汇总的出库金额 */
export async function getStockOutAmountSummaryByWarehouse(options?: { [key: string]: any }) {
    return request<BaseResponse<API.StockOutAmountSummaryByWarehouse[]>>('/api/chart/stock-out-amount-summary', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
        },
        ...(options || {}),
    });
}

export async function getStockDiffQuantity() {
  return request<BaseResponse<API.StockDiffQuantity[]>>('/api/chart/stockDiff', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

export async function getStockInGoodsQuantity() {
  return request<BaseResponse<API.GoodsQuantity[]>>('/api/chart/stock-out-goods-quantity', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
export async function getStockOutGoodsQuantity() {
  return request<BaseResponse<API.GoodsQuantity[]>>('/api/chart/stock-in-goods-quantity', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
